/*
 * @Author: qiuziz
 * @Date: 2017-08-15 10:24:59
 * */

import React from 'react';
import { Router, Route, Redirect, hashHistory, IndexRoute } from 'react-router';


import Home from '../container/home';
import MessageList from '../container/auditList/messagelist';
import Login from '../container/login';
import ReactCSSTransitionGroup from "react-addons-css-transition-group";
import BrowserUtils from './history';
class App extends React.Component {

  render() {
    return (
		<div className="container">
				<ReactCSSTransitionGroup
						component="div"
						transitionName={BrowserUtils.direction}
						transitionEnterTimeout={300}
						transitionLeaveTimeout={300}>
						<div key={this.props.location.pathname}
							style={{position: "absolute", width: "100%"}}>
							{
									this.props.children
							}
					</div>
				</ReactCSSTransitionGroup>
		</div>
    )
  }
}

export default (
	<Router history={hashHistory}>
		<Route>
				<Route path="/" component={App} >
					{
						<IndexRoute component={Home}/>
					}
					<Route path="/home" component={Home} />
					<Route path="/messageList" component={MessageList} />
					<Route path="/login" component={Login} />
				</Route>
				<Redirect from="*" to="/" />
		</Route>
	</Router>
);
